package team.dmh.wx.enums;

import lombok.Getter;

/**
 * @Auther: Hz1kai
 * @Date: 2018/10/22 14:57
 * @Description:
 */
@Getter
public enum QRCodeTypeEnum {

    NOT_EXPIRED(0, "二维码未过期"),
    EXPIRED(1, "二维码已过期"),
    LOGIN_SUCCESS(2,"登录成功"),
    NOT_EXIST(3,"二维码id不存在"),
    USE_ALREADY(4,"二维码已被使用")
    ;

    public final Integer type;
    public final String msg;

    QRCodeTypeEnum(Integer type, String msg) {
        this.msg = msg;
        this.type = type;
    }

    public static QRCodeTypeEnum getByCode(Integer type){
        for (QRCodeTypeEnum QRCodeStatusEnum:QRCodeTypeEnum.values()){
            if (QRCodeStatusEnum.type==type){
                return QRCodeStatusEnum;
            }
        }
        return  null;
    }
}
